﻿using System;
using System.Runtime.Caching;
using NUnit.Framework;
using OpenWaves.Caching;

namespace OpenWaves.UnitTests.Caching
{
    [TestFixture]
    public class MemoryCacheWrapperTests
    {
        [Test]
        public void Test()
        {
            var cache = new MemoryCacheWrapper<string>(new MemoryCache("Cache"));
            cache.InsertValue("key", "value1", TimeSpan.FromDays(1));
            cache.InsertValue("key", "value2", TimeSpan.FromDays(1));

            Assert.That(cache.GetValue("key"), Is.EqualTo("value2"));
        }
    }
}